Using Price Rule Lookup Queries Against Custom Objects
- Create a custom Promotion object with fields that store your promotional data: Start Date, End Date, Promo Code, and Discount (%). Start Date has a value of 4/1/2018, End Date has a value of 5/31/2018, Promo code has a value of Promo1, and Discount has a value of 10%.
- Add a Promo Code text field to your quote. When your price rule is active, your sales reps can enter Promo1 on the quote to receive a 10% discount.
- Create a price rule with the following fields.Evaluation Scope: CalculatorConditions Met: AllLookup Object: Promotion
- Evaluation Scope: Calculator
- Conditions Met: All
- Lookup Object: Promotion
- Create a price condition so that the price rule fires when your quote’s promo code field doesn’t have a blank value.
- Create your lookup queries. Test whether the quote’s promo code matches the promotion’s promo code, and whether the quote expires before the promotion begins. Remember that the tested field refers to the quote field you’re evaluating, and lookup field refers to the Promotion object field that you’re testing against. Each lookup query should have the quote as the tested object. After that, set up each query as follows.Tested FieldOperatorLookup FieldPromoCode__cequalsPromoCode__cSBQQ__ExpirationDate__cgreater thanStart_Date__cSBQQ__ExpirationDate__cless thanEnd_Date__c
- Create your price actions. Your price rule performs these actions when all its lookup queries are true. The first action sets your source lookup field to find the value of your quote line’s discount field and sends that value to your promotional discount field. The second action pulls the promotional discount into a formula to determine your quote line’s final listprice.This is your first price action.Target ObjectQuote LineTarget FieldPromotional Discount__cSource Lookup FieldDiscount__cThis is your second price action.Target ObjectQuote LineTarget FieldSBQQ__ListPrice__cFormulaSBQQ__OriginalPrice__c * (1 – Promotional_Discount__c)